#pragma once

#define		CASE_TREE_ROOT_NODE	0
#define		CASE_TREE_CASE_NODE	1
#define		CASE_TREE_SUBE_NODE	2
#define		CASE_TREE_ITEM_NODE	4
#define		CASE_TREE_OPER_NODE	3

// CCheckCaseTreeCtrl

class CCheckCaseTreeCtrl : public CTreeCtrl
{
	DECLARE_DYNAMIC(CCheckCaseTreeCtrl)

public:
	CCheckCaseTreeCtrl();
	virtual ~CCheckCaseTreeCtrl();

protected:
	CImageList		m_il;
	BOOL			m_isEditable;

	ck::CheckCase*	m_pCase;

public:

	void		SetCheckCase(ck::CheckCase* pCase);

	void		Populate(BOOL bIsShowAll=FALSE);
	void		AttachBitmap();

	int			GetNodeType(HTREEITEM hItem);
	z_uint32	GetCheckElementCode(HTREEITEM hItem);

protected:
	BOOL	PopulateSubElement(z_uint32 nParentCode, HTREEITEM hParentItem, BOOL bIsShowAll);
	BOOL	PopulateItem(z_uint32 nParentCode, HTREEITEM hParentItem, BOOL bIsShowAll);

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult);
};


